﻿using System;
using System.Web;
using System.Web.UI;
using Ue.CQRS.Samples.Infrastructure.MessageManagent;

namespace Ue.CQRS.Samples.UI.AppCode
{
    public class PageBase : Page,IMessage
    {
        private Lazy<MessageRender> lazyMessage;

        public PageBase()
            : base()
        {
            this.lazyMessage = new Lazy<MessageRender>(() => new MessageRender());
        }

        public void Alert(string message)
        {
            this.lazyMessage.Value.Alert(message);
        }
    }
}